package org.hcyspartnoc.demo.service.system;

import com.baomidou.mybatisplus.extension.service.IService;
import org.hcyspartnoc.demo.common.core.PageBean;
import org.hcyspartnoc.demo.common.exception.common.CommonUtilsException;
import org.hcyspartnoc.demo.common.exception.framework.AuthException;
import org.hcyspartnoc.demo.common.exception.system.SysRoleException;
import org.hcyspartnoc.demo.common.exception.system.SysUserException;
import org.hcyspartnoc.demo.pojo.dto.system.*;
import org.hcyspartnoc.demo.pojo.po.system.SysUserPo;
import org.hcyspartnoc.demo.pojo.vo.system.SysUserVo;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ISysUserService extends IService<SysUserPo> {
    String registerByWx(SysUserWxRegisterDto sysUserWxRegisterDto) throws SysUserException;

    SysUserVo loginByAccount(SysUserLoginByPhoneDto sysUserLoginByPhoneDto) throws SysUserException, CommonUtilsException;

    void logout() throws SysUserException;

    String modifyAvatar(MultipartFile image) throws CommonUtilsException, SysUserException;

    void modifyPassword(SysUserModifyPwdDto sysUserModifyPwdDto) throws SysUserException;

    void modifyBaseInfo(SysUserModifyBaseInfoDto sysUserModifyBaseInfoDto);

    SysUserVo queryByToken();

    void rebindingRole(SysUserRebindingRoleDto sysUserRebindingRoleDto) throws SysUserException, SysRoleException;

    void modifyStatus(SysUserModifyStatusDto sysUserModifyStatusDto) throws AuthException, SysUserException, SysRoleException;

//    PageBean<SysUserPo, SysUserVo> queryPage(Integer currentPage, Integer pageSize, String nickName, String phone, Integer status, Integer roleId);

    @Transactional
    PageBean<SysUserPo, SysUserVo> queryPage(Integer currentPage, Integer pageSize, String nickName, String account, List<Integer> roleIds, String sortField, String sortOrder);


    boolean saveOrUpdateUser(SysUserUpdateAndAddDto sysUserUpdateAndAddDto);

    void addNewUser(SysUserAddDto sysUserAddDto);

    boolean updateUser(SysUserUpdateAndAddDto sysUserUpdateAndAddDto);

    void removeuserByid(Integer user);
}
